#!/usr/bin/env bash

if bluetoothctl show | grep -q "Powered: no"; then
  printf "off"
elif bluetoothctl info | grep -q "Missing"; then
  printf "None"
else
  name=$(bluetoothctl info | grep -oP "Name:\s*\K(.{1,4})")
  printf "%s" $name
fi
